import pageComponentName from '@/config/page-component-name'
import Layout from '@/layout/index.vue'

const merchantRouter = [
  {
    path: '/merchant',
    component: Layout,
    name: 'merchant',
    meta: {
      title: '商家管理',
      icon: 'Shop',
    },
    children: [
      {
        path: 'list',
        component: () => import('@/views/merchant/list/index.vue'),
        name: 'list',
        meta: {
          title: '商家列表',
          keepAlive: true,
          icon: 'Shop',
          componentName: pageComponentName.merchant.merchantList,
        },
      },
      {
        path: 'check',
        component: () => import('@/views/merchant/check/index.vue'),
        name: 'check',
        meta: {
          title: '充值审核',
          keepAlive: true,
          componentName: pageComponentName.merchant.rechargeCheck,
        },
      },
      {
        path: 'set',
        component: () => import('@/views/merchant/set/index.vue'),
        name: 'set',
        meta: {
          title: '商家设置',
          keepAlive: true,
          componentName: pageComponentName.merchant.merchantSet,
        },
      },
      {
        path: 'new',
        component: () => import('@/views/merchant/new/index.vue'),
        name: 'new',
        meta: {
          title: '新建商家',
          keepAlive: true,
          componentName: pageComponentName.merchant.merchantForm,
        },
        hidden: true,
      },
      {
        path: 'newdetail/:id',
        component: () => import('@/views/merchant/new/index.vue'),
        name: 'newDetail',
        meta: {
          title: '编辑商家',
          keepAlive: true,
          componentName: pageComponentName.merchant.merchantForm,
        },
        hidden: true,
      },
      {
        path: 'listdetail/:id',
        component: () => import('@/views/merchant/detail/index.vue'),
        name: 'listDetail',
        meta: {
          title: '商家详情',
          keepAlive: true,
          componentName: pageComponentName.merchant.merchantDetail,
        },
        hidden: true,
      },
    ],
  },
]

export default merchantRouter
